(DEFUN C:HATDIFF ()
  (VL-LOAD-COM)
  (SETQ hat1 (NENTSELP))
  (SETQ hat2 (NENTSELP))
  (IF (AND hat1 hat2 (SETQ ename1 (CAR hat1))(SETQ ename2 (CAR hat2)))
    (PROGN
      (SETQ hatobj1 (VLAX-ENAME->VLA-OBJECT ename1))
      (SETQ hatobj2 (VLAX-ENAME->VLA-OBJECT ename2))
      (SETQ area1 (VLAX-GET-PROPERTY hatobj1 'Area))
      (SETQ area2 (VLAX-GET-PROPERTY hatobj2 'Area))
      (SETQ area-diff (- area1 area2))
;;; DIMLUNIT values:
;;; 1 = Scientific
;;; 2 = Decimal
;;; 3 = Engineering
;;; 4 = Architectural (always displayed stacked)
;;; 5 = Fractional (always displayed stacked)
;;; 6 = Microsoft Windows Desktop (decimal format using Control Panel settings for decimal separator and number grouping symbols)       (PRINC "\nArea 1 = ")
      (COND ((EQ (GETVAR "DIMLUNIT") 1)
             (SETQ unit-str " Sq. Units"
                   diml-str " Scientific Units"
                   upunit-str " Acres"
             ))
            ((EQ (GETVAR "DIMLUNIT") 2)
             (SETQ unit-str " SF"
                   diml-str " (Decimal Units)"
                   upunit-str " Acres"
             ))
            ((EQ (GETVAR "DIMLUNIT") 3)
             (SETQ unit-str " SF"
                   diml-str " (Engineering Units)"
                   upunit-str " Acres"
             ))
            ((EQ (GETVAR "DIMLUNIT") 4)
             (SETQ unit-str " Sq. In."
                   diml-str " (Architectural Units)"
                   upunit-str NIL
             ))
            ((EQ (GETVAR "DIMLUNIT") 5)
             (SETQ unit-str " Sq. Units"
                   diml-str " Fractional Units"
                   upunit-str " Acres"
             ))
      )
      (PRINC "\nArea 1 = ")
      (PRINC (RTOS area1 2 4))
      (PRINC unit-str)
      (PRINC "; Area 2 = ")
      (PRINC (RTOS area2 2 4))
      (PRINC unit-str)
      (PRINC diml-str)
      (PRINC "\nDifference in hatch areas = ")
      (PRINC (RTOS area-diff 2 4))
      (PRINC unit-str)
      (PRINC diml-str)
      (IF upunit-str
        (PRINC (STRCAT " (= " (RTOS (/ area-diff 43560.0) 2 3) upunit-str ")"))
      )
      (PRINC)
    )
  )
  (PRINC)
)
(DEFUN C:HD () (C:HATDIFF))
